import request from "@/utils/request"

// 查询用户列表
export function queryUser(data, { currentPage, size }) {
  return request({
    url: `/system/user/list/${currentPage}/${size}`,
    method: 'post',
    data
  })
}
// 添加用户
export function addUser(data) {
  return request({
    url: "/system/user",
    method: "post",
    data
  })
}

// 删除用户
export function deleteUser(id) {
  return request({
    url: `/system/user`,
    method: "delete",
    data: [id]
  })
}

// 修改用户
export function updateUserApi(data) {
  return request({
    url: "/system/user",
    method: "put",
    data
  })
}

// 用户详情
export function queryUserDetail(id) {
  return request({
    url: `/system/user/${id}`,
    method: "get",
  })
}

// 用户详情
export function searchTree(name) {
  return request({
    url: `/base/orgDict/searchTree?name=${name}`,
    method: "get",
  })
}






// 重置密码
export function resetPwdByAdmin(data) {
  return request({
    url: "/sysUser/resetPwdByAdmin",
    method: "put",
    data
  })
}

// 解锁账号
export function unLock(data) {
  return request({
    url: "/sysUser/unLock",
    method: "post",
    data
  })
}

// 修改组织
export function updateOrgManager(data) {
  return request({
    url: "/sysUser/updateOrgManager",
    method: "post",
    data
  })
}

// 左侧组织树形
export function queryUserTree() {
  return request({
    url: "/sysOrgManager/findChildrenTree",
    method: "get",
  })
}
